-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored main branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function genConst refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation) - Replace if statement with if expression (
assign-if-exp)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 157-161 refactored with the following changes:
- Replace a[0:x] with a[:x] and a[x:len(a)] with a[x:] (
remove-redundant-slice-index)
|
|
||
| U = Matrix([[1, 0, 0, 0], | ||
| [0, 0, 1, 0], | ||
| [0, 1, 0, 0], | ||
| [0, 0, 0, j]]) | ||
|
|
||
| Ei = Matrix([[E1],[0],[0],[E2]]) # vetor 4x1 | ||
|
|
||
| Eo = M*U*M*Ei | ||
|
|
||
| return Eo | ||
|
|
||
| return M*U*M*Ei |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function hybrid_2x4_90 refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
|
|
||
| # optical hybrid transfer matrix | ||
| T = np.array([[ 1/2, 1j/2, 1j/2, -1/2], | ||
| [ 1j/2, -1/2, 1/2, 1j/2], | ||
| [ 1j/2, 1/2, -1j/2, -1/2], | ||
| [-1/2, 1j/2, -1/2, 1j/2]]) | ||
|
|
||
| Ei = np.array([E1, np.zeros((E1.size,)), | ||
| np.zeros((E1.size,)), E2]) | ||
|
|
||
| Eo = T@Ei | ||
|
|
||
| return Eo | ||
|
|
||
| return T@Ei |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function hybrid_2x4_90deg refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
|
|
||
| c = 299792458 # speed of light (vacuum) | ||
| c_kms = c/1e3 | ||
| λ = c_kms/Fc | ||
| α = alpha/(10*np.log10(np.exp(1))) | ||
| β2 = -(D*λ**2)/(2*np.pi*c_kms) | ||
| γ = gamma | ||
|
|
||
| Nfft = len(Ex) | ||
|
|
||
| ω = 2*np.pi*Fs*fftfreq(Nfft) | ||
|
|
||
| Nspans = int(np.floor(Ltotal/Lspan)) | ||
| Nsteps = int(np.floor(Lspan/hz)) | ||
|
|
||
| Ex = fft(Ex) #Pol. X | ||
| Ey = fft(Ey) #Pol. Y | ||
|
|
||
| linOperator = np.exp(-(α/2)*(hz/2) + 1j*(β2/2)*(ω**2)*(hz/2)) | ||
|
|
||
| for spanN in tqdm(range(1, Nspans+1)): | ||
| for stepN in range(1, Nsteps+1): | ||
|
|
||
|
|
||
| for _ in tqdm(range(1, Nspans+1)): | ||
| for _ in range(1, Nsteps+1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function manakovSSF refactored with the following changes:
- Replace unused for index with underscore [×2] (
for-index-underscore)
| bits_x = np.random.randint(2, size=3*2**14) | ||
| bits_x = np.random.randint(2, size=3*2**14) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 210-323 refactored with the following changes:
- Replace a[0:x] with a[:x] and a[x:len(a)] with a[x:] [×3] (
remove-redundant-slice-index)
Branch
mainrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
mainbranch, then run:Help us improve this pull request!